var namespace = function(namespace) {
  var nameParts = namespace.split('.');
  var scope = window;
  for (var i = 0; i < nameParts.length; i++) {    
    if (!scope[nameParts[i]]) {
      scope[nameParts[i]] = {};
    }
    scope = scope[nameParts[i]];
  }
};


var bind = function(fn, obj, args) {
  return function() {
    var finalArgs = [];
    if (arguments) {
      for (var i = 0; i < arguments.length; i++) {
        finalArgs.push(arguments[i]);
      }
    }
    if (args) {
      for (var i = 0; i < args.length; i++) {
        finalArgs.push(args[i]);
      }
    }
    return fn.apply(obj || window, finalArgs);
  };
};
